{include file="public/toper" /}
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">统计管理</a>
        <a><cite>共享押金统计</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">&#xe666;</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
            <input type="text" name="sreach" value=""  style="width:250px;" id="key"   placeholder="用户/订单号/门店" autocomplete="off" class="layui-input">
            <input type="text" name="sreach" value=""  style="width:300px;" id="sj"   placeholder="时间" readonly="readonly" autocomplete="off" class="layui-input">
            <button class="layui-btn" id="search"><i class="layui-icon">&#xe615;</i></button>
        </div>
    </div>
    <xblock class="demoTable">
        <span class="layui-btn" ><a href="{:url('Stati/index')}" style="color: #fff">平台订单统计</a></span>
        <span class="layui-btn" ><a href="{:url('Stati/index2')}" style="color: #fff">分销佣金统计</a></span>
        <span class="layui-btn" ><a href="{:url('Stati/index3')}" style="color: #fff">共享订单统计</a></span>
        <span class="layui-btn" ><a href="{:url('Stati/index4')}" style="color: #fff">分类共享统计</a></span>
        <span class="layui-btn" ><a href="{:url('Stati/index6')}" style="color: #fff">会员卡购买统计</a></span>
    </xblock>
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>
<script type="text/html" id="sn">
    <div><a href="#"  onclick="x_admin_show('查看订单','{:url(\'Order/order_details\')}?id={{d.order_id}}')" title="查看详情" class="layui-table-link">{{d.order_sn}}</a></div>
</script>
<script>
    layui.use(['table','util','layer','laydate'], function(){
        var table = layui.table, $ = layui.jquery;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var loading = layer.load(1, {shade: [0.1,'#fff'] });
        var tableIn = table.render({
            method: 'post',
            elem: '#test'
            ,url: "{:url('Stati/index5')}"
            ,id:'test'
            ,cols: [[
                {field:'order_id', width:80, title: '序号',align: 'center',type:'numbers'}
                ,{width:190, title: '订单号',align: 'center',totalRowText:'合计',templet:'#sn'}
                ,{field:'sname',width:150,title: '用户',align: 'center'}
                ,{field:'stname',width:200,title: '门店',align: 'center'}
                ,{field:'deposit_price',width: 150,title: '支付押金', align: 'center',totalRow: true}
                ,{field:'refund_price',width: 150,title: '退还押金', align: 'center',totalRow: true}
                ,{field:'add_time', width:180, title: '下单时间',align: 'center',templet: '<div>{{layui.util.toDateString(d.add_time*1000)}}</div>'}
                ,{field:'confirm_time', width:180, title: '完成时间',align: 'center',templet: '<div>{{layui.util.toDateString(d.confirm_time*1000)}}</div>'}
            ]]
            ,page:true
            ,limit: 30
            ,limits:[30,60,90,120,150,180,210,240,270,300]
            ,totalRow:true
        });
        layer.close(loading);

        laydate.render({
            elem: '#sj'
            ,type: 'datetime'
            ,range: true
        });


        $('#search').on('click', function () {
            tableIn.reload({
                where: {key: $('#key').val(),sj:$('#sj').val()}
                ,page: {curr: 1 }
            });
        });
    });
</script>
{include file="public/footer"/}